﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using WeChartWorkRobot.Model;

namespace WeChartWorkRobot.Service
{
    public static class LoginService
    {
        public static CookieContainer Login(this JiraConfig jiraConfig)
        {
            MyHttpRequest httpClient = new MyHttpRequest(jiraConfig.JiraHost + "/rest/gadget/1.0/login");
            CookieContainer _cookieContainer = httpClient.Login($"os_username={jiraConfig.JiraUserName}&os_password={jiraConfig.JiraPassword}&os_cookie=true");
            return _cookieContainer;
        }
    }
}
